//
//  ShangChengHeaderView.m
//  NBProduct
//
//  Created by ping on 15/11/2.
//  Copyright (c) 2015年 ping. All rights reserved.
//

#import "ShangChengHeaderView.h"

@implementation ShangChengHeaderView

-(instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        [self initView];
    }
    
    return self;
}
-(void)initView{
    NSLog(@"%f",self.height);
    self.backgroundColor = LIGHTGRAYBACKCOLOR;
    
    if (self.height <= 32* _kscH) {
        backView = [[UIView alloc]initWithFrame:CGRectMake(0,0, KScreenWidth, 30 * _kscH)];
        
    }else{
        backView = [[UIView alloc]initWithFrame:CGRectMake(0, 100 * _kscH, KScreenWidth, 30 * _kscH)];
    }
    backView.backgroundColor = [UIColor clearColor];
//    backView = [[UIView alloc]initWithFrame:CGRectMake(0, self.height - 30 * _kscH, KreenWidth, 30 * _kscH)];
    
//    backView.backgroundColor = [UIColor whiteColor];
    [self addSubview:backView];
    
    _titleLael = [[UILabel alloc]initWithFrame:CGRectMake(10 * _kscW, 5 * _kscH, KScreenWidth - 80 * _kscW, 20 * _kscH)];
    [backView addSubview:_titleLael];
    _titleLael.font = [UIFont systemFontOfSize:12];
    _titleLael.textColor = MaintextColor;
    
    _moreLabel = [[UILabel alloc]initWithFrame:CGRectMake(_titleLael.right, _titleLael.top, 60 * _kscW, _titleLael.height)];
    _moreLabel.textAlignment = NSTextAlignmentRight;
    _moreLabel.text = @"更多>>";
    _moreLabel.hidden = YES;
    
    [self addSubview:_moreLabel];
//    
//    UILabel *fenGelabel = [[UILabel alloc]initWithFrame:CGRectMake(0, self.height - 2, KreenWidth, 2)];
//    fenGelabel.backgroundColor = LIGHTGRAYBACKCOLOR;
//    [self addSubview:fenGelabel];
    
    _moreBtn = [[UIButton alloc]initWithFrame:CGRectMake(0, 0, self.width, self.height)];
    [self addSubview:_moreBtn];
    
    
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
